<?php

/**
 * This is the control file.
 * It acts as the medium between the viewUser.php file,
 * and the dbUser.php file.
 */
class User {

    //these private variables are only accessible in this class,
    //we have to use functions or other methods to use them

    private $userID;
    private $username;
    private $password;
    private $fname;
    private $lname;
    private $permissionlevel;

    function __construct($username, $password, $fname, $lname, $permissionlevel) {
        $this->userID = null;
        $this->username = $username;
        $this->password = $password;
        $this->fname = $fname;
        $this->lname = $lname;
        $this->permissionlevel = $permissionlevel;
    }

    function setUserID($userID) {
        $this->userID = $userID;
    }

    function setUsername($username) {
        $this->username = $username;
    }

    function setPassword($password) {
        $this->password = $password;
    }

    function setLname($lname) {
        $this->lname = $lname;
    }

    function setFname($fname) {
        $this->fname = $fname;
    }

    function setPermissionLevel($permissionlevel) {
        $this->permissionlevel = $permissionlevel;
    }

    function getUserID() {
        return $this->userID;
    }

    function getUsername() {
        return $this->username;
    }

    function getPassword() {
        return $this->password;
    }

    function getLname() {
        return $this->lname;
    }

    function getFname() {
        return $this->fname;
    }

    function getPermissionLevel() {
        return $this->permissionlevel;
    }

    function printAllAttributes() {
        $output = sprintf("Username: %s, Password: %s, First Name: %s,
            Last Name: %s, Permission Level: %s.",
                $this->username, $this->password, $this->fname, $this->lname,
                $this->permissionLevel);
        return $output;
    }

}

?>